The present invention relates to a system including both a method and an apparatus for limiting the magnitude of sampled data. In particular, the system relates to limiting the magnitude of data signals, particularly when sampled at low sampling rates, using a digital signal processor.
Many techniques may be used for peak limiting signals so that their magnitude does not exceed a predetermined maximum level. Analog techniques for limiting signal magnitude may be implemented in a variety of manners including fast-attack, slow-release, automatic gain controlled (AGC) amplifiers; diode audio frequency clippers; diode radio frequency clippers; and fast-attack, slow-release AGC amplifiers employing delay lines.
Unfortunately, limiting the magnitude of sampled data signals in a digital signal processing context is difficult to accurately and easily implement. One intuitive approach is to simply limit each sampled data point to a maximum level. This approach, however, is unacceptable at lower sampling rates as is explained below.
It is well known that an analog signal can be adequately digitally represented and processed as long as it is sampled at a rate greater than the Nyquist sampling rate, i.e. at twice the highest frequency component of the sampled signal. Moreover, practical systems often require the lowest possible sampling rate (approaching the Nyquist rate) be used to conserve digital signal processing time. At these lower rates, signals may be sampled only twice a cycle. As a result, at particular points in the signal cycle (i.e., phase) the samples may not exceed the limit level, even though the peak magnitude of the sampled analog signal in fact exceeds the limit level.
This problem is illustrated in FIG. 1(a) where an analog input waveform 10 exceeds a magnitude limit level, shown as a dotted line, during the peak portions of each cycle. An ideal band-limited limiter circuit such as that shown in FIG. 1(b) attenuates the input signal 10 so that an ideal waveform 14 would be output to prevent signal distortion. Such an ideal band-limiter is frequently used in radio transmission paths, and a periodic input signal, i.e. a sinusoid, is amplitude limited in an analog limiter 11 to produce a clipped waveform 12. A low-pass filter 13 smooths out the clipped waveform to produce the ideal band-limited output signal 14.
In a digital context, if sampling occurs during one cycle at 0.degree., 90.degree., 180.degree., and 270.degree. as indicated by the triangular points on waveform 10, then it is possible to approach this ideal model and generate a properly limited output signal. However, if the data sampling point is phase shifted by 45.degree., as indicated by the square sample points on input waveform 10, the magnitude of all samples is less the limit level, and the erroneous conclusion is reached that no signal limiting is required. As a result, signals that should be limited may not be limited at low sampling rates.
Unfortunately, when the signal is sampled at low sampling rates, it is inevitable that at some point the samples will not be properly limited. Consequently, when the unlimited sampled signal is later reconstructed in a digital to analog converter, the output analog waveform exceeds the desired limit level and exhibits objectionable distortion, especially when the frequency of the analog input signal is at or near a subharmonic of the sample rate.
The above example demonstrates clearly that the maximum level of the reconstructed output signal depends unpredictably (and objectionably) upon the phase of the input signal at sampling. One potential solution to these problems is to interpolate the sampled signal to effectively increase sampling to several times the Nyquist sampling rate to provide more samples per signal cycle. The major drawback with this approach is the significant increase in digital signal processing time required to perform the interpolation and then to process the data at the higher sampling rate making this approach impractical.
Another approach would be to perform automatic gain control by averaging several samples and computing a time averaged gain constant which is then used to scale every sample. Unfortunately, this solution requires the limiter to work virtually instantaneously to ensure that no portion of the signal exceeds the given magnitude limit. Conventional AGC functions are not fast enough to work instantaneously.
The present invention overcomes the limitations and drawbacks of the above described approaches to limiting the magnitude of sampled data signals. Each data input sample, corresponding to a real component of the sample, is used to generate the imaginary component of a complex vector corresponding to the input sample by adding 90.degree. of phase shift to the sample. The magnitude of the complex phasor of the data sample is then calculated by taking the square root of the sum of the squares of the real and imaginary components. If the calculated magnitude of the complex phasor exceeds a preset magnitude limit, then the sample is scaled by a scaling factor, i.e. the ratio of the calculated phasor magnitude to the preset magnitude limit. In this way, the data sample is limited irrespective of where (and when) the sample occurs in the analog input signal cycle. Moreover, the limited sample has the same phase as the input sample, and low sampling rates may be used without the disadvantages noted above.
Thus, the present invention provides a method for limiting the magnitude of an input signal where the input signal is sampled and transformed to obtain its component in-phase and quadrature components. The phasor magnitude of the signal sample is determined from those in-phase and quadrature components, and the input sample is limited based on the relationship of the phasor magnitude to a predetermined limit value. Specifically, the limiting step includes scaling the sample input signal using a ratio of the predetermined threshold to the phasor magnitude.
The present invention may be used in an audio signal processing environment to limit the magnitude of a digitized analog audio signal. The analog audio signal is sampled at a sampling rate that is low relative to the frequency of the analog audio signal to generate an input sample. The input sample is transformed into its complex real and imaginary components using a Hilbert transform. The magnitude of the complex signal corresponding to the input signal is determined, and that complex magnitude is then compared to a predetermined threshold. If the complex magnitude exceeds that threshold, the input sample is scaled by the ratio of the predetermined threshold to the complex magnitude. The scaled input signal is then converted to analog form.
The present invention provides for a signal processing system for processing analog audio frequency signals. A first CODEC converts analog signals into digitized input samples. A digital signal processor receiving the digitized samples includes means for transforming each sampled input signal to obtain its in-phase and quadrature components; means for calculating a complex phasor of the sampled input signal from the in-phase and quadrature components; means for comparing a complex magnitude to a threshold value; and means for limiting the input signal based on the comparison. A second CODEC then converts the limited sample signals, generated by the means for limiting, into an appropriately limited analog output signal.
The present invention effectively limits the magnitude of signals at very low sample rates, i.e. approaching the Nyquist sampling rate. By operating at minimum sampling rates, digital signal processing resources are conserved. In addition, a large linear region of operation is provided for the limiter according to the present invention, e.g. approximately 85% of the maximum output level. The remaining margin of 15% is necessary to compensate for overshoot in digital-to-analog conversion of output signals from the digital signal processor.